﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace appTriangle
{
    class Program
    {
        static void Main(string[] args)
        {
            double dSide1=0;
            double dSide2=0;
            double dSide3=0;
            //int precision = 0;

            Console.WriteLine("(5, 5, 5)"); 
            clsTriangle.GetTriangleType(1, 1, 1);
            Console.WriteLine();

            Console.WriteLine("(3, 4, 5)"); 
            clsTriangle.GetTriangleType(3, 4, 5);
            Console.WriteLine();

            Console.WriteLine("(4, 4, 5)"); 
            clsTriangle.GetTriangleType(4, 4, 5);
            Console.WriteLine();

            Console.WriteLine("(3, 5, 7)"); 
            clsTriangle.GetTriangleType(3, 5, 7);
            Console.WriteLine();

            Console.WriteLine("(3, 10, 1)"); 
            clsTriangle.GetTriangleType(3, 10, 1);
            Console.WriteLine();

            Console.WriteLine("(1, 1, 1.4142)");
            clsTriangle.GetTriangleType(1, 1, 1.4142);
            Console.WriteLine();

            Console.WriteLine("Now you enter side lengths for your own testing");

            Console.WriteLine("Enter Side 1 length:");
            string side1 = Console.ReadLine();
            try
            {
                dSide1 = Double.Parse(side1);
            }
            catch
            {
                Console.WriteLine("Error: invalid non-numeric input");
                Console.ReadLine();
                return;
            }
            if (dSide1 <= 0)
            {
                Console.WriteLine("Error: Invalid input value. A triangle's sides must each be greater than zero");
                Console.ReadLine();
                return;
            }
            if (dSide1 > 1000000)
            {
                Console.WriteLine("Error: Invalid input value. Sides must each be less than one million.");
                Console.ReadLine();
                return;
            }

            Console.WriteLine("Enter Side 2 length:");
            string side2 = Console.ReadLine();
            try
            {
                dSide2 = Double.Parse(side2);
            }
            catch
            {
                Console.WriteLine("Error: invalid non-numeric input");
                Console.ReadLine();
                return;
            }

            if (dSide2 <= 0)
            {
                Console.WriteLine("Error: Invalid input value. A triangle's sides must each be greater than zero");
                Console.ReadLine();
                return;
            }
            if (dSide2 > 1000000)
            {
                Console.WriteLine("Error: Invalid input value. Sides must each be less than one million.");
                Console.ReadLine();
                return;
            }

            Console.WriteLine("Enter Side 3 length:");
            string side3 = Console.ReadLine();
            try
            {
                dSide3 = Double.Parse(side3);
            }
            catch
            {
                Console.WriteLine("Error: invalid non-numeric input");
                Console.ReadLine();
                return;
            }
            if (dSide3 <= 0)
            {
                Console.WriteLine("Error: Invalid input value. A triangle's sides must each be greater than zero");
                Console.ReadLine();
                return;
            }
            if (dSide3 > 1000000)
            {
                Console.WriteLine("Error: Invalid input value. Sides must each be less than one million.");
                Console.ReadLine();
                return;
            }

            //if (side1.Contains(".") || side2.Contains(".") || side3.Contains("."))
            //{
            //    //Console.WriteLine("Enter Output Precision for Comparision:");
            //    Console.WriteLine("To what decimal precision you want computation comparision round to?");
            //    string strPrecision = Console.ReadLine();
            //    Int32.TryParse(strPrecision, out precision);
            //    if (precision < 0)
            //    {
            //        Console.WriteLine("Invalid Input. Terminating...Enter any key to exit");
            //        Console.ReadLine();
            //        return;
            //    }
            //}

            //clsTriangle.SetTrianglePrecision(precision);
            clsTriangle.GetTriangleType(dSide1, dSide2, dSide3);
            Console.WriteLine();

            Console.WriteLine("Enter any key to exit");
            Console.ReadLine();  
        }
    }
}
